<template>
	<view class="container">
		<view class="college-video" v-if="type==1">
			<video :style="{height:swiperheight+'px'}" :custom-cache="false" loop="true" class="video" id="index" :controls="true" :src="detail.content" :show-center-play-btn="false">
				<cover-view class="controls-title">{{detail.title}}</cover-view>
			</video>
		</view>
		<view class="college-imagetext" v-if="type==2">
			<view class="college-title">{{detail.title}}</view>
			<view class="college-content" v-html="detail.content"></view>
		</view>
		<view class="college-audio" v-if="type==3">
			
		</view>
	</view>
</template>

<script>
	import apicollege from '../../common/api/college';
	export default {
		data() {
			return {
				type:1,		//1视频2图文3音频
				swiperheight:100,
				
				data_params:{
					id:0,
				},
				
				detail:{},
				
			};
		},
		onLoad(option) {
			console.log('onLoad')
			let accept_data = JSON.parse(option.data)
			this.type = accept_data.type
			this.data_params.id = accept_data.id
		},
		components:{
			
		},
		created(){
			this.getlistHeight()
			this.college_detail()
		},
		methods:{
			
			
			getlistHeight(){
				let screen = uni.getSystemInfoSync()
				this.swiperheight=screen.screenHeight
			},
			
			//商学院列表
			college_detail(){
				apicollege.college_detail(this.data_params).then(res =>{
					console.log(res)
					if(res.code == 1){
						this.detail = res.data
					}
				}).catch(cateres =>{
					
				});
			},
		}
	}
</script>

<style lang="scss">
	.college-video{
		width:100%;
		.video{
			width:100%;
		}
	}
	.controls-title{
		color:#FFFFFF;
		position: absolute;
		top:10upx;
		width:90%;
		left:4%;
	}
	.college-title{
		text-align: center;
		font-weight:bold;
		font-size: 35upx;
	}
	.college-content{
		padding:20upx;
	}
</style>
